{include file="public/header" /}
<link rel="stylesheet" type="text/css" href="/static/js/h-ui.admin/css/H-ui.tab.css"/>
<body>
<style>
    .cion{
        display: inline-block;
        width: 120px;
    }
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 量化监控
    <span class="c-gray en">&gt;</span> 持仓监控
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="/quantization/etc" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form  method="get" action="">

    </form>

    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            当前价格：{$markPrice} : 价格时间：{:date('Y-m-d H:i:s',$priceTime)}
        </span>
    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="9">策略列表</th>
        </tr>
        <tr class="text-c">
            <th width="80">策略</th>
            <th width="80">总资产</th>
            <th width="50">手数</th>
            <th width="80">保证金</th>
            <th width="80">持仓</th>
            <th width="40">未触发手数</th>
            <th width="40">平仓手数</th>
            <th width="40">止盈手数</th>
            <th width="50">上报时间</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $v}
        <tr class="text-c">
            <td class="text-l">
                名称:{$v->strategy}<br>
                平台：{$v->platform}<br>
                标的：{$v->symbol}<br>
            </td>
            <td class="text-l">
               总资产： {$v->equity}<br>
                总收益： {$v->PNL}<br>
                手续费：{$v->commission}<br>
            </td>
           <td class="text-l">
                多头手数：{$v->shares->L}<br>
                空头手数：{$v->shares->S}<br>
               多头真实：{$v->volumes->L}<br>
               空头真实：{$v->volumes->S}<br>
            </td>
            <td class="text-l">
                多头占用：{$v->securityCash->L}<br>
                空头占用：{$v->securityCash->S}<br>
                可用{$v->cashAvailable}
            </td>
            <td class="text-l">
                多头均价：{$v->avgPrice->L}<br>
                空头均价：{$v->avgPrice->S}<br>
                多头浮动盈亏：{$v->volumes->L*$markPrice - $v->volumes->L*$v->avgPrice->L}<br>
                空头浮动盈亏：{$v->volumes->S*$v->avgPrice->S-$v->volumes->S*$markPrice}<br>
            </td>
            <td class="text-l">
                多头：{$v->unrealizeShares->L}<br>
                空头：{$v->unrealizeShares->S}<br>
            </td>
            <td class="text-l">
                今日：{$v->todayClosePositionNum }<br>
                总共：{$v->totalClosePositionNum }<br>
            </td>
            <td class="text-l">
                今日：{$v->todayClosePositionWinNum}<br>
                总共：{$v->totalClosePositionWinNum}<br>
            </td>
            <td>{:date('Y-m-d H:i:s',$v->timestamp)}</td>
        </tr>
        {/foreach}
        </tbody>
    </table>
</div>

{include file="public/footer" /}

<script type="text/javascript">
    function member_start(obj,id,status){
        if(status == 1){
            var info = '确认要禁用吗？';
        }else{
            var info = '确认要启用吗？';
        }
        layer.confirm(info,function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('status')}",
                data: {id:id,status:status},
                dataType: 'json',
                success: function(data){
                    if(data.status == 'y'){
                        layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                            location.replace(location.href);
                        });
                    }else{
                        layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }
    function profit_start(obj,id,profit_status){
        if(profit_status == 1){
            var info = '确认禁止发放矿机收益吗？';
        }else{
            var info = '确认开启发放矿机收益吗？';
        }
        layer.confirm(info,function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('profit_status')}",
                data: {id:id,status:profit_status},
                dataType: 'json',
                success: function(data){
                    if(data.status == 'y'){
                        layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                            location.replace(location.href);
                        });
                    }else{
                        layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }
    function auth(obj,id,status,field){
        if(status == 0){
            var info = '确认要启用吗？';
        }else{
            var info = '确认要禁用吗？';
        }
        layer.confirm(info,function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('auth')}",
                data: {id:id,status:status,field:field},
                dataType: 'json',
                success: function(data){
                    if(data.status == 'y'){
                        layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                            location.replace(location.href);
                        });
                    }else{
                        layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }

</script>